<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2.6.10/dist/vue.js"></script>
</head>
<body>
    <div id="app"> 
   <span>{{gradeAvg}}</span> 
   <span>{{mygrade()}}</span>

    </div>
<script>
    var app = new Vue({
    el:"#app",

    data:{
        student:[ 
            {name:"张三",grade:65},
            {name:"李四",grade:95},
            {name:"牛华",grade:45},
            {name:"麻子",grade:85},
            {name:"杰克",grade:35}]
    },
    computed:{
        gradeAvg(){
            return (this.student[0].grade+this.student[1].grade+this.student[2].grade+this.student[3].grade+this.student[4].grade)/this.student.length
        }
    },
    methods:{
        mygrade(){
            return this.student[0].grade+1
        }
    }


    })
    



</script>
    
</body>
</html>